home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Technotools
/
Technotools (Chestnut CD-ROM)(1993).ISO
/
lang_asm
/
objxref
/
sda.mac
< prev
next >
Wrap
Text File
|
1985-05-28
|
7KB
|
475 lines
;;
;; Support Macros - Screen Design Aid
;; May 1985 - Copyright - Dan Daetwyler
;; Route 5, Box 518A
;; Springdale, AR 72764
;; (501) 756-0212
;;
;; ALL RIGHTS RESERVED
;;
;;
;; Internal Use Only Macro
;;
$FDDEF MACRO
IFNDEF $SDA
EXTRN $SDA:NEAR
ENDIF
ENDM
;;
;; Internal Use Only Macro
;;
$FDNTL MACRO P1,P2,P3,P4,P5,P6
$FDDEF
MOV DX,OFFSET P1
IFNB <P2>
MOV P1.FLD,P2
ENDIF
IFNB <P3>
MOV P1.DAT,OFFSET P3
ENDIF
IFIDN <P4>,<0>
MOV P1.FKY,0
ELSE
IFNB <P4>
MOV P1.FKY,OFFSET P4
MOV P1.FKD,25
ENDIF
ENDIF
IFIDN <P5>,<0>
MOV P1.KYL,0
ELSE
IFNB <P5>
MOV P1.KYL,OFFSET P5
ENDIF
ENDIF
IFIDN <P6>,<0>
MOV P1.ERM,0
ELSE
IFNB <P6>
MOV P1.ERM,OFFSET P6
MOV P1.ERD,24
ENDIF
ENDIF
ENDM
;;
;; Full Display Screen Process
;;
$DISPLY MACRO P1,P2,P3,P4,P5,P6
IFNDEF $SDAF
EXTRN $SDAF:NEAR
ENDIF
MOV DX,OFFSET P1
IFNB <P2>
MOV P1.TSTR,P2
ENDIF
MOV P1.TFLD,OFFSET P3
IFNB <P4>
IFIDN <P4>,<0>
MOV P1.FKY,0
ELSE
MOV P1.FKY,OFFSET P4
MOV P1.FKD,25
ENDIF
ENDIF
IFNB <P5>
IFIDN <P5>,<0>
MOV P1.KYL,0
ELSE
MOV P1.KYL,OFFSET P5
ENDIF
ENDIF
IFNB <P6>
IFIDN <P6>,<0>
MOV P1.ERM,0
ELSE
MOV P1.ERM,OFFSET P6
MOV P1.ERD,24
ENDIF
ENDIF
CALL $SDAF
ENDM
;;
;; String to Field
;;
$FDOUT MACRO P1,P2,P3,P4,P5,P6
MOV P1.OPN,1
$FDNTL P1,P2,P3,P4,P5,P6
CALL $SDA
ENDM
;;
;; Field to String
;;
$FDINP MACRO P1,P2,P3,P4,P5,P6
MOV P1.OPN,2
$FDNTL P1,P2,P3,P4,P5,P6
CALL $SDA
ENDM
;;
;; String-Field O/I
;;
$FDOIN MACRO P1,P2,P3,P4,P5,P6
MOV P1.OPN,4
$FDNTL P1,P2,P3,P4,P5,P6
CALL $SDA
ENDM
;;
;; Binary to Field
;;
$FDBOU MACRO P1,P2,P3,P4,P5,P6
MOV P1.OPN,1+8
$FDNTL P1,P2,P3,P4,P5,P6
CALL $SDA
ENDM
;;
;; Field to Binary
;;
$FDBIN MACRO P1,P2,P3,P4,P5,P6
MOV P1.OPN,2+8
$FDNTL P1,P2,P3,P4,P5,P6
CALL $SDA
ENDM
;;
;; Binary-Field O/I
;;
$FDBOI MACRO P1,P2,P3,P4,P5,P6
MOV P1.OPN,4+8
$FDNTL P1,P2,P3,P4,P5,P6
CALL $SDA
ENDM
;;
;; Date to Field
;;
$FDDOU MACRO P1,P2,P3,P4,P5,P6
MOV P1.OPN,1+16
$FDNTL P1,P2,P3,P4,P5,P6
CALL $SDA
ENDM
;;
;; Field to Date
;;
$FDDIN MACRO P1,P2,P3,P4,P5,P6
MOV P1.OPN,2+16
$FDNTL P1,P2,P3,P4,P5,P6
CALL $SDA
ENDM
;;
;; Date-Field O/I
;;
$FDDOI MACRO P1,P2,P3,P4,P5,P6
MOV P1.OPN,4+16
$FDNTL P1,P2,P3,P4,P5,P6
CALL $SDA
ENDM
;;
;; Time to Field
;;
$FDTOU MACRO P1,P2,P3,P4,P5,P6
MOV P1.OPN,1+32
$FDNTL P1,P2,P3,P4,P5,P6
CALL $SDA
ENDM
;;
;; Field to Time
;;
$FDTIN MACRO P1,P2,P3,P4,P5,P6
MOV P1.OPN,2+32
$FDNTL P1,P2,P3,P4,P5,P6
CALL $SDA
ENDM
;;
;; Time-Field O/I
;;
$FDTOI MACRO P1,P2,P3,P4,P5,P6
MOV P1.OPN,4+32
$FDNTL P1,P2,P3,P4,P5,P6
CALL $SDA
ENDM
;;
;; Clear Field
;;
$FDCLR MACRO P1,P2
$FDDEF
MOV DX,OFFSET P1
IFNB <P2>
MOV P1.FLD,P2
ENDIF
MOV P1.OPN,1+64
CALL $SDA
ENDM
;;
;; Get Field Attribute
;;
$FDGAT MACRO P1,P2
$FDDEF
MOV DX,OFFSET P1
MOV P1.OPN,2+64
IFNB <P2>
MOV P1.FLD,P2
ENDIF
CALL $SDA
ENDM
;;
;; Set Field Attribute
;;
$FDSAT MACRO P1,P2
$FDDEF
MOV DX,OFFSET P1
MOV P1.OPN,4+64
IFNB <P2>
MOV P1.FLD,P2
ENDIF
CALL $SDA
ENDM
;;
;; Position Cursor to Field
;;
$FDPOS MACRO P1,P2
$FDDEF
MOV DX,OFFSET P1
MOV P1.OPN,1+128
IFNB <P2>
MOV P1.FLD,P2
ENDIF
CALL $SDA
ENDM
;;
;; Reverse "video" for specified field
;;
$SVIDEO MACRO P1,P2
$FDDEF
MOV DX,OFFSET P1
MOV P1.OPN,2+128
IFNB <P2>
MOV P1.FLD,P2
ENDIF
CALL $SDA
ENDM
;;
;; Restore original attribute for a specified field
;;
$SVREST MACRO P1,P2
$FDDEF
MOV DX,OFFSET P1
MOV P1.OPN,4+128
IFNB <P2>
MOV P1.FLD,P2
ENDIF
CALL $SDA
ENDM
;;
;; Define General Attribute
;;
$SCATR MACRO P1
IFNDEF $SDAA
EXTRN $SDAA:NEAR
ENDIF
MOV AL,P1
CALL $SDAA
ENDM
;;
;; Clear Screen
;;
$SCCLR MACRO P1,P2,P3,P4
IFNDEF $SDAC
EXTRN $SDAC:NEAR
ENDIF
IFIDN <P1>,<FULL>
XOR BP,BP
MOV DX,184FH
ELSE
MOV BP,P1*100H+P2
MOV DX,P3*100H+P4
ENDIF
CALL $SDAC
ENDM
;;
;; String Input
;;
$SCINP MACRO P1
IFNDEF $SDAI
EXTRN $SDAI:NEAR
ENDIF
IFNB <P1>
MOV SI,OFFSET P1
ENDIF
CALL $SDAI
ENDM
;;
;; String O/I
;;
$SCOIN MACRO P1,P2
IFNDEF $SDAX
EXTRN $SDAX:NEAR
ENDIF
IFNB <P1>
MOV DX,OFFSET P1
ENDIF
IFNB <P2>
MOV SI,OFFSET P2
ENDIF
CALL $SDAX
ENDM
;;
;; String Output
;;
$SCOUT MACRO P1
IFNDEF $SDAO
EXTRN $SDAO:NEAR
ENDIF
IFNB <P1>
MOV DX,OFFSET P1
ENDIF
CALL $SDAO
ENDM
;;
;; Position Cursor
;;
$SCPOS MACRO P1,P2
IFNDEF $SDAP
EXTRN $SDAP:NEAR
ENDIF
IFNB <P1>
MOV DX,P1*100H+P2
ENDIF
CALL $SDAP
ENDM
;;
;; Set Cursor Appearance
;;
$SCURA MACRO P1,P2
IFNDEF $SDAL
EXTRN $SDAL:NEAR
ENDIF
$FD1 = 0
$SCC1 P1,$FD1
$SCC1 P2,$FD1
MOV AL,$FD1
CALL $SDAL
ENDM
$SCC1 MACRO P1,P2
IFIDN <P1>,<ON>
P2 = P2 + 1
ELSE
IFIDN <P1>,<LINE>
P2 = P2 + 16
ELSE
IFIDN <P1>,<BLOCK>
P2 = P2 + 32
ENDIF
ENDIF
ENDIF
ENDM
;;
;; Display Image
;;
$SDISP MACRO P1,P2
IFNDEF $SDAD
EXTRN $SDAD:NEAR
ENDIF
IFNB <P2>
MOV SI,OFFSET P2
ELSE
XOR SI,SI
ENDIF
MOV DX,OFFSET P1
CALL $SDAD
ENDM
;;
;; Display Image - With Date/Time
;;
$SDISPX MACRO P1,P2
IFNDEF $SDADX
EXTRN $SDADX:NEAR
ENDIF
IFNB <P2>
MOV SI,OFFSET P2
ELSE
XOR SI,SI
ENDIF
MOV DX,OFFSET P1
CALL $SDADX
ENDM
;;
;; Set Error Message Vector
;;
$SERRM MACRO P1,P2,P3
MOV P1.ERD,P2
MOV P1.ERM,OFFSET P3
ENDM
;;
;; Set Field Table Vector
;;
$SFLDV MACRO P1,P2,P3,P4
MOV P1.TSTR,P3
MOV P1.TCND,P2
MOV P1.TFLD.OFFSET P4
ENDM
;;
;; Set Function Key List Vector
;;
$SFUNK MACRO P1,P2,P3
MOV P1.FKY,OFFSET P3
MOV P1.FKD,P2
ENDM
;;
;; Set Termination Key List Vector
;;
$STRMK MACRO P1,P2
MOV P1.KYL,OFFSET P2
ENDM
;;
;; Load Time Interrupt
;;
$FDDTS MACRO P1
IFIDN <P1>,<ON>
IFNDEF $SDZON
EXTRN $SDZON:NEAR
ENDIF
CALL $SDZON
ELSE
IFIDN <P1>,<OFF>
IFNDEF $SDZOF
EXTRN $SDZOF:NEAR
ENDIF
CALL $SDZOF
ELSE
DX ?
ENDIF
ENDIF
ENDM
;;
;; Define Field Table Entry
;;
$DEFLD MACRO P1,P2,P3,P4
L1 = 0
IFDIF <P2>,<C>
IFIDN <P2>,<B>
L1 = 8
ELSE
IFIDN <P2>,<D>
L1 = 16
ELSE
IFIDN <P2>,<T>
L1 = 32
ELSE
DX ? ;Error
ENDIF
ENDIF
ENDIF
ENDIF
IFIDN <P3>,<O>
L1 = L1 + 1
ELSE
IFIDN <P3>,<I>
L1 = L1 + 2
ELSE
IFIDN <P3>,<X>
L1 = L1 + 4
ELSE
DX ? ;Error
ENDIF
ENDIF
ENDIF
DW L1 * 100H + P1,P4
ENDM